package com.wondersgroup.fjzlpt.org.controller.view.xymb;

import com.wondersgroup.fjzlpt.org.service.inter.xymb.XymbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * 协议管理
 * Created by lion on 2017/6/30.
 */
@Controller
@RequestMapping("/xymb")
public class XymbController {

    @Autowired
    private XymbService xymbService;

    /**
     * 协议模板列表
     * @param request
     * @return
     */
    @RequestMapping("/index.html")
    public String index(HttpServletRequest request){
        return "xymb/index";
    }

    /**
     * 协议模板编辑
     * @param request
     * @return
     */
    @RequestMapping("/manager.html")
    public String manager(HttpServletRequest request){
        String uri = "xymb/manager-";
        String XYMBID = request.getParameter("XYMBID");
        request.setAttribute("XYMBID", XYMBID);
        String XYMBMC = request.getParameter("XYMBMC");
        request.setAttribute("XYMBMC", XYMBMC);
        String type = request.getParameter("XYMBLX");
        request.setAttribute("ZT", request.getParameter("ZT"));
        return uri+type;
    }

    /**
     * 获取静态模板
     * @param request
     * @return
     */
    @RequestMapping("/getTemplate")
    public String getTemplate(HttpServletRequest request){
        String template = request.getParameter("template");
        return "xymb/"+template;
    }

    /**
     * 机构服务项弹出选择窗
     * @param request
     * @return
     */
    @RequestMapping("/win_jgfwx.html")
    public String jgfwx(HttpServletRequest request){
        return "xymb/win_jgfwx";
    }
}
